﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Task01
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = "C:\\Windows";
            GetFiles(path);
        }

        private static void GetFiles(string directory)
        {
            try
            {
                string[] files = Directory.GetFiles(directory, "*.exe");

                foreach (string file in files)
                {
                    Console.WriteLine(file);
                }

                string[] directories = Directory.GetDirectories(directory);

                foreach (string dir in directories)
                {
                    GetFiles(dir);
                }
            }
            catch
            {
                return;
            }
        }
    }
}
